<include file="Public/head" title="积分商城"/>
<include file="Public/back_head"/>
<div class="main">
    <ul class="index_slider_warp">
    <foreach name="list" item="val">
        <li class="index_slider_list clear">
            <a href="{:U('Integral/detail',array('id'=>$val['id']))}">
                <div class="index_list_left" style="background-image: url(__PUBLIC__/home/image/bike_show1.jpg)"></div>
                <div class="index_list_right clear">
                    <div class="index_list_title">{$val.goods_name}</div>
                    <div class="index_list_abstract">{$val.profile}</div>
                    <div class="index_list_money"><em class="price-display">{$val.integral_price}</em>积分</div>
                    <div class="index_list_shop">已兑换<span class="index_list_num">{$val.sale_count}</span></div>
                </div>
            </a>
        </li>
    </foreach>
    </ul>
     <div class="ajaxMore"></div>
</div>
<script>
var page = 1;
var is_end = false;
$(function(){
    //滑动加载
    $(window).scroll(function(){
        var wheight = $(this).height();
        var dheight = $(document).height();
        var sheight = $(this).scrollTop();
        if((wheight+sheight)+10>=dheight && !is_end){
            page++;
            $('.ajaxMore').html('加载中...');
            add_more();
        }
    });
})
function add_more(){
    $.post(
        "{:U('')}",
        {page:page},
        function(data){
            if(data.status == '0'){
                is_end = true;
                $('.ajaxMore').html('加载完毕!');
            }else{
                $('.index_slider_warp').append(data);
            }
        }
    )
}
</script>
<include file="Public/foot"/>